from django_filters import rest_framework as filters

from bookshop.models import UserInfo


# 定义通过手机号查找用户的过滤化器类
class UserFilter(filters.FilterSet):
    class Meta:
        model = UserInfo  # 模型名
        fields = {
            "phone": ['exact'],
            # 定义phone进行查找， exact为精确查找
        }
